
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Comedy Option
 */
public class RoomView{
    private BufferedImage statusImage;
    private Room repRoom;
    private int width;
    private int height;
    private int x;
    private int y;
    private Color bgColor;


    public RoomView(Room initRoom, int initWidth, int initHeight, int initX, int initY){
        repRoom = initRoom;
        width = initWidth;
        height = initHeight;
        x = initX;
        y = initY;
        bgColor = Color.white;
    }
    
    public void decideImage(){
        try{
            if(repRoom.getCurrentStatus() == Room.status.Dirty)
               statusImage = ImageIO.read(new File("src/BedDirty.jpg"));
            else if(repRoom.getCurrentStatus() == Room.status.Available)
               statusImage = ImageIO.read(new File("src/BedClean.jpg"));
            else if(repRoom.getCurrentStatus() == Room.status.Booked)
                statusImage = ImageIO.read(new File("src/BedReserved.jpg"));
            else if(repRoom.getCurrentStatus() == Room.status.Occupied)
                statusImage = ImageIO.read(new File("src/BedOccupied.jpg"));
            else statusImage = null;
        }catch(IOException e){
            statusImage = null;
        }
    }
    
    public BufferedImage getImage(){
        return statusImage;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public Room getRepRoom() {
        return repRoom;
    }

    public void setRepRoom(Room repRoom) {
        this.repRoom = repRoom;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
    
    public Color getBgColor() {
        return bgColor;
    }

    public void setBgColor(Color bgColor) {
        this.bgColor = bgColor;
    }
    
    
}
